/*--------------------------------------------------------------------------------------*\
**
** dialog_kingdom_trade.h
**
** Heroes IV
** Copyright 2000, The 3DO Company
**
\*--------------------------------------------------------------------------------------*/

#ifndef DIALOG_KINGDOM_TRADE_H_INCLUDED
#define DIALOG_KINGDOM_TRADE_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <vector>
#include "bitmap_group_ptr.h"
#include "game_window.h"
#include "material_icons.h"
#include "player_color.h"

class   t_adventure_frame;
class   t_button;
class   t_player;
class   t_scrollbar;
class   t_text_window;
class	t_bitmap_layer_window;

class t_dialog_kingdom_trade : public t_window
{
public:
	t_dialog_kingdom_trade ( t_window* parent );
    void init_dialog( t_window *parent, t_adventure_frame* frame, std::string const& name_text, std::string const& intro_text );

protected:
	t_bitmap_group_ptr		    m_bitmaps_ptr;
	t_button *                  m_give_button;
	t_bitmap_layer_window *		m_give_icon;

    int                         m_max_quantity;
    t_button *                  m_max_button;
    
	t_text_window *             m_amount_text[k_material_count];
	t_window *                  m_flag_frame;
	t_adventure_frame*          m_frame;
	std::vector<t_screen_point> m_frame_locations;
    int                         m_quantity;
	t_text_window *             m_quantity_text;
    
    t_button *                  m_material_button[k_material_count];
	t_window *					m_material_frame;
	int							m_material_index;
    t_button *                  m_player_button[k_active_player_color_count-1];
	t_player_color				m_player_color[k_active_player_color_count-1];
	std::vector<t_screen_point> m_player_frame_locations;
	t_player *                  m_player_ptr;
	int						    m_player_funds;
	int							m_target_player_index;
	t_player *                  m_target_player_ptr;
	int						    m_target_player_funds;
	t_scrollbar *               m_scrollbar;

    void close_click( t_button* button );
	void flag_clicked( t_button* button, int index );
    void give_clicked( t_button* button );
    void material_clicked( t_button* button, int index );
    void max_clicked( t_button* button );
    void scrollbar_move( t_scrollbar* scrollbar, int value );
    void show_material_amount ();
};

#endif // DIALOG_KINGDOM_TRADE_H_INCLUDED
